﻿<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true"
    CodeFile="FleetCompanyList.aspx.cs" Inherits="carinsurance_fleet_FleetCompanyList" %>

<%@ Register Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"
    Namespace="System.Web.UI" TagPrefix="asp" %>
<asp:Content ID="Content3" ContentPlaceHolderID="cphPageTitle" runat="Server">
    <h1>
        <asp:Label runat="server" Text="Fleet Company List" ID="lblPageName"></asp:Label></h1>
</asp:Content>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <asp:Label runat="server" Text="<%$Resources:General,LangOption%>" Visible="false"
        ID="lblLangOption" /><asp:HiddenField ID="hidLastTab" Value="0" runat="server" />
    <asp:HiddenField ID="hidCallType" Value="0" runat="server" />
    <asp:HyperLink runat="server" Visible="false" ID="lnkNewCarUsage" NavigateUrl="#"
        Text="New"></asp:HyperLink>
    <div class="bc2">
        <asp:UpdatePanel ID="UpdatePanel4" runat="server">
            <ContentTemplate>
                <asp:Label runat="server" ID="lblNewCallMessage" /></ContentTemplate>
        </asp:UpdatePanel>
        <asp:Label runat="server" ID="lblSiteLocation" Text="You are here : " CssClass="bclist" />
        <asp:SiteMapPath SiteMapProvider="SiteUserSiteMapProvider" ID="smpProvider" runat="server"
            PathSeparator=" : ">
            <PathSeparatorStyle CssClass="bcarrow" />
            <CurrentNodeStyle CssClass="bclist" />
            <NodeStyle CssClass="bclink" />
            <RootNodeStyle CssClass="bclink" />
        </asp:SiteMapPath>
        <div class="clear">
        </div>
    </div>
    <div class="topdisplay pb10">
        <table width="100%" border="0" cellpadding="0" cellspacing="0">
            <asp:Panel ID="pnlSearch" runat="server">
                <tr>
                    <td width="300">
                        <label>
                            Search By (Company Name, ContactPerson, Email) :
                        </label>
                    </td>
                    <td width="150">
                        <asp:TextBox ID="txtSearch" runat="server" Width="250px" ToolTip="Company Name, ContactPerson, Email"
                            MaxLength="100" />
                    </td>
                    <td>
                        <asp:Button ID="btnSearch" runat="server" Text="<%$Resources:General,Search%>" ValidationGroup="search"
                            OnClick="btnSearch_Click" CssClass="blueB ml10" OnClientClick="return SubmitSearchConfirm();" />
                        &nbsp;&nbsp;
                        <asp:Button ID="btnNewCompany" runat="server" CssClass="blueB ml10" OnClick="btnNewCompany_Click" Text="New Company" />
                        &nbsp;&nbsp;
                        <asp:Label runat="server" ID="lblSearchMessage" Text="" ForeColor="Red" />
                    </td>
                </tr>
            </asp:Panel>
        </table>
    </div>
    <div style="display: none;">
        <asp:TextBox ID="txtCompanyId" runat="server" CausesValidation="false" Text="0"></asp:TextBox>
    </div>
    <div id="divCompany" class="toggle" runat="server">
        <div class="title opened" id="opened1">
            <img src="../../images/icons/dark/imagesList.png" alt="" class="titleIcon" />
            <h6>
                <asp:Label ID="lblLastCallStatusCaption" runat="server" Text="Fleet Company" />
                <asp:Label ID="lblLastCallStatusMessage" runat="server" Text="" ForeColor="Red" />
            </h6>
        </div>
        <div class="form">
            <fieldset class="step">
                <asp:UpdatePanel ID="upnlCompany" runat="server">
                    <ContentTemplate>
                        <asp:Panel ID="pnlCompany" runat="server">
                            <asp:GridView ID="grvFleetCompany" runat="server" AllowPaging="false" AutoGenerateColumns="False"
                                Width="100%" EmptyDataText="<%$Resources:General,ErrNodata%>" CssClass="sTable"
                                GridLines="None" DataKeyNames="CompanyId,AgentId" OnSelectedIndexChanged="grvFleetCompany_SelectedIndexChanged"
                                OnRowCommand="grvFleetCompany_RowCommand" >
                                <Columns>
                                    <asp:BoundField DataField="AgentId" HeaderText="AgentId" 
                                        ReadOnly="True" SortExpression="AgentId" Visible="False" />
                                    <asp:BoundField DataField="CompanyId" HeaderText="CompanyId" 
                                        ReadOnly="True" SortExpression="CompanyId" />
                                    <asp:BoundField DataField="CompanyName" ItemStyle-Width="250px" HeaderText="Company Name"
                                        SortExpression="CompanyName">
                                        <ItemStyle Width="250px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ContactPerson" ItemStyle-Width="250px" HeaderText="Contact Person"
                                        SortExpression="ContactPerson">
                                        <ItemStyle Width="250px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="Email" ItemStyle-Width="250px" HeaderText="Email" SortExpression="Email">
                                        <ItemStyle Width="250px"></ItemStyle>
                                    </asp:BoundField>
                                    <asp:BoundField DataField="ContactNo1" HeaderText="Contact No.1" SortExpression="ContactNo1" />
                                    <asp:CommandField Visible="true" ButtonType="Button" ControlStyle-CssClass="blueB ml10"
                                ItemStyle-HorizontalAlign="Center" HeaderText="Edit"
                                SelectText="Edit" ShowSelectButton="true" />                       
                                                
                            <asp:TemplateField HeaderText="<%$Resources:CarInsurance,Delete%>">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="btnDelete" Text="<%$Resources:CarInsurance,Delete%>"
                                        CommandName="MyDelete" CommandArgument='<%#Eval("CompanyId")%>' OnClientClick="javascript:return SubmitCompanyDeleteConfirm();"
                                        CssClass="blueB ml10" />
                                </ItemTemplate>
                            </asp:TemplateField>                         
                            <asp:TemplateField HeaderText="CarDetail">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="btnCar" Text="CarDetail"
                                        CommandName="MyCar" CommandArgument='<%#Eval("CompanyId")%>' OnClientClick="javascript:return SubmitGotoCarConfirm();"
                                        CssClass="blueB ml10" />
                                </ItemTemplate>
                            </asp:TemplateField>                       
                            <asp:TemplateField HeaderText="Quote">
                                <ItemTemplate>
                                    <asp:Button runat="server" ID="btnQuote" Text="Quote"
                                        CommandName="MyQuote" CommandArgument='<%#Eval("CompanyId")%>' OnClientClick="javascript:return SubmitGotoQuoteConfirm();"
                                        CssClass="blueB ml10" />
                                </ItemTemplate>
                            </asp:TemplateField>  
                                </Columns>
                                <FooterStyle />
                                <PagerStyle />
                                <SelectedRowStyle />
                                <HeaderStyle />
                                <EditRowStyle />
                                <AlternatingRowStyle />
                                <RowStyle />
                            </asp:GridView>
                            <div class="clear">
                            </div>
                        </asp:Panel>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </fieldset>
        </div>
    </div>

    <script type="text/javascript">
        function SubmitCompanyDeleteConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmDelete")%>');
            return _retVal;
        }

        function SubmitGotoCarConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmNext")%>');
            return _retVal;
        }

        function SubmitGotoFileConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmtoGoFileUpload")%>');
            return _retVal;
        }

        function SubmitGotoQuoteConfirm() {
            var _retVal = false;
            _retVal = confirm('<%=GetGlobalResourceObject("General", "ConfirmtoGoManualQuote")%>');
            return _retVal;
        }
        
    </script>

</asp:Content>
